//
//  MSTool.h
//  MS
//
//  Created by He Yuan on 13-2-6.
//  Copyright (c) 2013年 He Yuan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RegexKitLite.h"

@interface MSTool : NSObject

+(BOOL)checkEmailValue:(NSString*)string;

+(UILabel *)createLable:(CGRect)rect;

+(UITextField *)createTextField:(CGRect)rect;

+(UIButton *)createButton:(CGRect)rect action:(SEL)sel delegate:(id)delegate;

+(void)showAlert:(NSString*)msg;

+(void)showAlert:(NSString*)msg delegate:(id)d;

+(void)showAlertTitle:(NSString*)title message:(NSString *)msg delegate:(id)d;

+(void)showAlertTitle:(NSString*)title message:(NSString *)msg;

+(void)showHUD:(NSString*)msg done:(BOOL)done;

+(void)showHUD:(NSString*)msg done:(BOOL)done inView:(UIView *)v;

+(void)refreshHUDText:(NSString*)msg;

+(void)refreshHUD:(NSString*)msg done:(BOOL)done;

+(void)showHUD:(NSString *)msg inView:(UIView *)v;

+(void)showHUD:(NSString *)msg;

+(void)hideHUD:(BOOL)done;

+(void)hideHUD;

+(long)getRandomNumber:(long)from to:(long)to;

+(long)getRandomNumber;

+(NSString *)TrimJsonChar:(NSString *)jsonstr;

+(NSString *)trimmingWhiteSpaceCharacter:(NSString *)str;

+ (NSString *)documentsDirectory;

+ (NSString *)imagePathWithSubDir:(NSString *)subDir;

+(void)createFileDirIfNotExists:(NSString *)fileDir;

+ (NSString *)tmpDirectory;

+ (NSString *)cacheRandomImages;

+(NSString *)convertStringEnCodeToUTF8:(NSString *)string;

+(NSUInteger)getByteForStringLenth:(NSString *)string;

+(void)showError:(NSError *)error;

+(NSError *)createError:(NSInteger)errorcode localDescription:(NSString *)des;

+(NSString *)convertObjectToJson:(NSDictionary *)obj;

+(NSDictionary *)convertJsonToDictionary:(NSString *)json;

@end
